#include <iostream>

using namespace std;

class A{

public:
    A(){}
    A(A &other){*this = other;}
    ~A(){}

    int set(int a){m_=a;}
    int get(){return m_;}
    A *getaddress(){return (this);};
private:
    int m_;
};

int main(int argc, const char *argv[])
{
 
    A a1;
 
    cout << "the address of a1's this:" << a1.getaddress() <<endl;

    cout << "the address of a1:" << &a1 <<endl;

    cout << a1.get()<< endl;

    a1.set(10);

    cout << "after set a1:" << a1.get() << endl;

    A a2(a1);


    cout << "the address of a2's this:" << a2.getaddress() <<endl;
    cout << "the address of a2:" << &a2 <<endl;

    cout  << a2.get() <<endl;

    cout << "change the value of a2"<< endl;

    a2.set(11);

    cout << "the value of a1 is:" << a1.get() << endl;

    return 0;
}
